package cn.com.lyj6851.modules.wechat.controller;

import cn.binarywang.wx.miniapp.bean.WxMaLiveResult;
import cn.com.lyj6851.api.ApiResult;
import cn.com.lyj6851.modules.mp.service.YdyWechatLiveService;
import cn.com.lyj6851.modules.mp.service.dto.YdyWechatLiveQueryCriteria;
import cn.com.lyj6851.modules.mp.vo.WechatLiveVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* 
*/
@AllArgsConstructor
@Api(tags = "wxlive管理")
@RestController
@RequestMapping
public class WechatLiveController {

    private final YdyWechatLiveService yxWechatLiveService;


    @GetMapping("yxWechatLive")
    @ApiOperation("查询所有直播间")
    public ApiResult<WechatLiveVo> getYdyWechatLives(YdyWechatLiveQueryCriteria criteria, Pageable pageable){
        return ApiResult.ok(yxWechatLiveService.queryAll(criteria,pageable));
    }
    @GetMapping("yxWechatLive/getLiveReplay/{id}")
    @ApiOperation("获取直播回放")
    public ApiResult<List<WxMaLiveResult.LiveReplay>>  getLiveReplay(@PathVariable Integer id){
        return ApiResult.ok(yxWechatLiveService.getLiveReplay(id));
    }
}